#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @File : common_function.py
# @Autor: FY
# @Date: 2021/8/30
import os


def get_projectDir():
    '''
    获取工程路径
    :return: str
    '''
    cur_dir = os.path.abspath(os.curdir)
    print("current dir is {}".format(cur_dir))
    index = cur_dir.rfind("test_cases")
    pro_dir = cur_dir[0 : index]
    if index == -1:
        pro_dir = cur_dir
        if pro_dir[-1] != '\\':
            pro_dir = pro_dir + "\\"
    print("project dir is {}".format(pro_dir))
    return  pro_dir